package com.tongshu.naive.chat.socket.handler;

import com.tongshu.naive.chat.application.UIService;
import com.tongshu.naive.chat.socket.MyBizHandler;
import com.tongshu.naive.chat.ui.view.chat.IChatMethod;
import io.netty.channel.Channel;
import javafx.application.Platform;
import protocol.talk.TalkNoticeResponse;

public class TalkNoticeHandler extends MyBizHandler<TalkNoticeResponse> {
    public TalkNoticeHandler(UIService uiService) {
        super(uiService);
    }

    @Override
    public void channelRead(Channel channel, TalkNoticeResponse msg) {
        IChatMethod chatMethod = uiService.getiChatMethod();
        Platform.runLater(()->{
            chatMethod.addTalkBox(-1,0, msg.getTalkId(), msg.getTalkName(), msg.getTalkHead(), msg.getTalkSketch(), msg.getTalkDate(), false);
        });
    }
}
